import request from '../../request/index'
const state = {
    User: []
}
const getters = {

}
const mutations = {
    setData(state, data) {
        state.User = data
    },
    forgetPass(state, data) {
        let { user, pass } = data
        let item = state.User.filter(item => {
            return item.user === user
        })
        console.log(item);
        item.forEach(item => {
            request({
                url: '/forgetPass',
                method: 'GET',
                params: { pass, ifID: item.ifID }
            })
        })

    }
}
const actions = {
    async getNavList(store) {
        let res = await request({
            url: '/OneUser',
            method: 'GET',
            params: {}
        }).then(res => {
            store.commit('setData', res)
            return res
        })
        return res
    }
}
export default {
    namespaced: true,
    state,
    getters,
    mutations,
    actions
}